import * as Cesium from "cesium";
import PolyLineMaterialPropetry from "./material/PolyLineMaterialPropetry";
import SpriteLineMaterial from "./material/SpriteLineMaterial";
export default class RoadsLine {
  constructor(viewer) {
    const dataSource = Cesium.GeoJsonDataSource.load(
      "/geojson/roadsLine.geojson"
    );
    dataSource.then((source) => {
      viewer.dataSources.add(source);
      // 获取实例
      const entitles = source.entities.values;
      entitles.forEach((item) => {
        // item.polyline.material = new PolyLineMaterialPropetry(
        //   new Cesium.Color(0.2, 1.0, 1.0, 1.0)
        // );
        item.polyline.material = new SpriteLineMaterial();
      });
    });
  }
}
